<?php
include_once("clases/Conexion.php");
include_once("clases/MenuManager.php");
include_once("clases/SubMenuManager.php");
include_once("clases/ItemManager.php");
include_once("clases/MarcadorManager.php");


$link = new Conexion("localhost", "root", "root", "menues");
$objmenues = new MenuManager();
$objsubmenues = new SubMenuManager();
$objitem = new ItemManager();
$objmarcador = new MarcadorManager();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <noscript>Your browser does not support JavaScript!</noscript>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="css/style.css" rel="stylesheet" type="text/css"  />
        <link rel="stylesheet" href="css/styleEncabezado.css" type="text/css" />
        <script type="text/javascript" src="./js/jquery-latest.js"></script>
        <link rel="stylesheet" href="css/thickbox.css" type="text/css" />
        <script type="text/javascript" src="js/thickbox.js"></script>
        <script type="text/javascript" src="js/cargarCombo.js"></script>


        <title>MENÚ </title>
    </head>

    <body>
        <div id="contenido">
            <div class="menu">
                <div id="menu_i"></div>	<div id="menu_d"></div>
                <ul>
                    <li><a href="#">Nuevo</a>
                        <ul><span></span>
                            <li><a href="nuevo.php?keepThis=true&TB_iframe=true&height=200&width=400&modal=true" title="Alta Rubro" class="thickbox" id="Rubro">Rubro</a></li>
                            <li><a href="nuevo_sub_menu.php?keepThis=true&TB_iframe=true&height=300&width=400&modal=true" title="Alta SubRubro/Item" class="thickbox" id="SubRubro">SubRubro/item</a></li>
                            <li><a href="nuevo_item.php?keepThis=true&TB_iframe=true&height=300&width=400&modal=true" title="Alta Item" class="thickbox" id="item">Item</a></li>
                            <li><a href="nuevo_marcador.php?keepThis=true&TB_iframe=true&height=500&width=400&modal=true" title="Alta Marcador" class="thickbox" id="marcadores">Marcador</a></li>
                        </ul>
                    </li>
                    <li><a href="#">Modificar</a>
                        <ul><span></span>
                            <li><a href="index.php?accion=adminMenu">RUBRO</a></li>
                            <li><a href="index.php?accion=adminSubmenu">SUBRUBRO/ITEM</a></li>
                            <li><a href="index.php?accion=adminItems">ITEM</a></li>
                            <li><a href="index.php?accion=adminMarcador">MARCADOR</a></li>
                        </ul></li>
                    <li><a href="#">Subir</a>
                        <ul><span></span>
                            <li><a href="JSonMenu.php?keepThis=true&TB_iframe=true&height=300&width=500" class="thickbox">Rubros</a></li>
                            <li><a href="JSonMarcadores.php?keepThis=true&TB_iframe=true&height=300&width=500" class="thickbox">Marcadores</a></li>
                        </ul>
                    </li>
                    <li><a href="entrada.php?keepThis=true&TB_iframe=true&height=300&width=500" title="INSTRUCCIONES" class="thickbox">Instrucciones</a>
                        <ul><span></span>
                    </ul></li>
<li><a href="../index.html" title="MAPA">Ir al mapa</a>
                        <ul><span></span>
                    </ul></li>
                </ul>
            </div><!-- fin Menu -->
            <br/><br/><br/><br/><br/><br/><br/>
            <?php
            switch ($_GET['accion']) {
                case "add": $objmenues->addMenu();
                    break;
                case "addSubMenu": $objsubmenues->addSubMenu();
                    break;
                case "additem": $objitem->addItem();
                    break;
                case "addMarcador": $objmarcador->addMarcador();
                    break;
                case "update": $objmenues->updateMenu();
                    break;
                case "updateSubMenu": $objsubmenues->updateSubMenu();
                    break;
                case "updateItem": $objitem->updateItem();
                    break;
                case "updateMarcador": $objmarcador->updateMarcador();
                    break;
                case "delete": $objmenues->deleteMenu();
                    break;
                case "deleteSubMenu": $objsubmenues->deleteSubMenu();
                    break;
                case "deleteItem": $objitem->deleteItem();
                    break;
                case "deleteMarc": $objmarcador->deleteMarcador();
                    break;
                case "adminItems": $objitem->listItem();
                    break;
                case "adminMenu": $objmenues->listMenu();
                    break;
                case "adminSubmenu": $objsubmenues->listSubMenu();
                    break;
                case "adminMarcador": $objmarcador->listMarcador();
                    break;
                case "upJsonMarc":include 'JSonMarcadores.php';
                    break;
                case "upJsonMenu":include 'JSonMenu.php';
                    break;
                default: $objmenues->listMenu();
            }
            ?>
        </div><!--  fin Contenido -->
    </body>
</html>	